﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using zzh_the_Visual_Studio.DAL;
using zzh_the_Visual_Studio.Models;

namespace zzh_the_Visual_Studio.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class StudentsController : ControllerBase
    {
        private DAL_Students dalstudents = new DAL_Students();

        [HttpGet]

        //学生界面，仅显示姓名、学号
        public List<students> getStudents()
        {
            return dalstudents.getStudents();
        }
        /// <summary>
        /// 查询个人信息
        /// </summary>
        /// <param name="a">学生信息中需要查询的值</param>
        /// <returns>获取个人信息</returns>
        /// <remarks>by:zzh 2021/12/10</remarks>
        public List<students_classes> getStudent(students_classes a)
        {
            return dalstudents.getStudent(a);
        }
        /// <summary>
        /// 查询个人成绩
        /// </summary>
        /// <param name="b">学生成绩中需要查询的值</param>
        /// <returns>获取个人成绩</returns>
        /// <remarks>by:zzh 2021/12/10</remarks>
        public List<students_scores> getScore(students_scores b)
        {
            return dalstudents.getScore(b);
        }
        //详细学生信息，s_id,姓名，学号，电话，身份证，学年，班级名称，专业名称，二级学院
        //和DAL中同理
        public List<students_classes> detailStudents()
        {
            return dalstudents.detailStudents();
        }
        //查询成绩
        public List<students_scores> getScores()
        {
            return dalstudents.getScores();
        }
    }
}